package com.hzdl.library.dao;

import com.hzdl.library.domain.Admin;
import com.hzdl.library.util.JDBCUtils;
import org.junit.Test;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class DaoTest {

    JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());

    @Test
    public void aa(){

        String sql = "select * from admin";

        List<Admin> list = template.query(sql, new BeanPropertyRowMapper<Admin>(Admin.class));

        System.out.println(list);

    }

}
